# - Try to find Xtst  
# Once done this will define  
#  
#  Xtst_FOUND - system has Xtst  
#  Xtst_INCLUDE_DIRS - the Xtst include directory  
#  Xtst_LIBRARIES - Link these to use Xtst  
  
find_path(Xtst_INCLUDE_DIR  
  NAMES X11/extensions/XTest.h  
  PATHS /usr/include /usr/local/include  
  PATH_SUFFIXES X11 X11/extensions  
)  
  
find_library(Xtst_LIBRARY  
  NAMES Xtst  
  PATHS /usr/lib /usr/local/lib  
)  
  
# handle the QUIETLY and REQUIRED arguments and set Xtst_FOUND to TRUE if  
# all listed variables are TRUE  
include(FindPackageHandleStandardArgs)  
find_package_handle_standard_args(Xtst DEFAULT_MSG  
  Xtst_LIBRARY Xtst_INCLUDE_DIR  
)  
  
if(Xtst_FOUND)  
  set(Xtst_LIBRARIES ${Xtst_LIBRARY})  
  set(Xtst_INCLUDE_DIRS ${Xtst_INCLUDE_DIR})  
endif()  
  
mark_as_advanced(Xtst_LIBRARY Xtst_INCLUDE_DIR)